print(-45<<2) #-180
'''
11111111111111111111111111010011 //-45
<<2
--------------------------------------
11111111111111111111111101001100 //-180
'''

print(89>>2) #22
'''
1011001 //89
>>2
------------------
10110 //22
'''

print(-123>>2) #-31
'''
11111111111111111111111110000101//-123
>>2
-------------------------------------
11111111111111111111111111100001 //-31
'''

print(~-890) #889
'''
11111111111111111111110010000110 //-890
~
------------------------------------------
00000000000000000000001101111001 //889
'''

print(-12^-89) #83
'''
11111111111111111111111111110100//-12
^
11111111111111111111111110100111//-89
-------------------------------------
00000000000000000000000001010011 //83
'''

print(456&451)#448
'''
00000000 00000000 00000001 11001000//456
&
00000000 00000000 00000001 11000011 //451
---------------------------------------------
00000000 00000000 00000001 11000000 //448
'''

print(63|-78) #-65
'''
00000000 00000000 00000000 00111111//63
|
11111111 11111111 11111111 10110010 //-78
-----------------------------------------------
11111111 11111111 11111111 10111111 //-65
'''

# 3有字符串a="abcd12344sd"，获取字符d
ret=a[3]

# 4.有字符串a="sadas11234dasd"，获取字符串"1234"
ret=a[6:10]
# 5."abcd"+"sadasd"
"abcdsadasd"
# 6."abcd"*2
"abcdabcd"
# 7."abcd"*2.0
报错！
# 8.把数据100,45.678,"HelloPython"拼接成字符串"哇哈哈100,小骑士45.6780,我爱学HelloPython"
# 要求三种方法！
a=100
b=45.678
c="HelloPython"
方法1：
ret="哇哈哈"+str(a)+",小骑士"+str(b)+"0,我爱学HelloPython"
#方法2:
ret="哇哈哈%d,小骑士%.4f,我爱学%s"%(a,b,c)
#方法3
ret="哇哈哈{},小骑士{},我爱学{}".format(a,b,c)
# 9.下面这些字符串函数的含义、以及分别举一个例子
# count
a="abcd1234adac1234dsa"
ret=a.count("1234")

# startwith
a="abcd123"
ret=a.startswith("abcd")

# find
a="abcd1234sadas1234dsa"
ret=a.find("1234")

# format
# replace
a="abcd1234dsad1234dsaad1234sdsd"
ret=a.replace("1234","Hello")

# split
a="K001,张三,13760453683,深圳市龙华区"
ret=a.split(",") #ret=["K001","张三","13760453683","深圳市龙华区"]

# join
ret=",".join("abcd") #ret="a,b,c,d"
ret=",".join(["abc","def","1234"]) #ret="abc,def,1234"

# strip
a="abcd113244abcdsd123dbcaca"
ret=a.strip("dbac") #ret="113244abcdsd123"

# 10.有字符串a="我爱中国",变成"国中爱我"
# 要求两种方法！
a="我爱中国"

#方法1
# a=a[::-1]

# 11.有列表a=[10,20,30]，获取元素20
ret=a[1]


# 12.有列表a=[10,20,30,40,50]，获取列表[30,40]
ret=a[2:-1]
# 13.有列表a=[10,20,30,40,50],获取[50,40,30,20,10]
# 要求3种！
a=[10,20,30,40,50]
#方法1
# a=a[::-1]
#方法2
a.reverse()
#方法3：sort
a.sort(reverse=True)

# 14.有列表a=[10,20,30,40,50],删除元素20
# 要求3种！
a=[10,20,30,40,50]
#方法1
del a[1]
#方法2
ret=a.pop(1)
#方法3
a.remove(20)
# 15.说明列表中以下函数的含义、举一个例子
# append
a=[10,20,30,"hello"]
a.append(40)

# insert
a=[10,20,30,"hello"]
a.insert(2,"HelloPython")

# count
a=[10,20,"abcd",10,"abcd",20,"abcd"]
ret=a.count("abcd")

# index
a=[10,20,"abcd",10,"abcd",20,"abcd"]
ret=a.index("abcd")

# pop
a=[10,20,"abcd",10,"abcd",20,"abcd"]
ret=a.pop(2)

# sort
a=[10,20,"abcd",10,"abcd",20,"abcd"]
a.sort()
a.sort(reverse=True)
# 16.




